package com.mt.customer.controller;

import com.mt.common.PagerInfo;
import com.mt.common.ServiceResult;
import com.mt.customer.api.service.ICustomerCourseService;
import com.mt.customer.entity.CustomerCourseEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;
@CrossOrigin
@RestController
public class CustomerCourseController {

    @Autowired
    ICustomerCourseService customerCourseService;

    @GetMapping("/customerCourse/findList")
    ServiceResult<List<CustomerCourseEntity>> findList(Map<String, Object> params, PagerInfo<?> pagerInfo) {
        return customerCourseService.findList(params, pagerInfo);
    }

    @GetMapping("/customerCourse/findInfo")
    ServiceResult<CustomerCourseEntity> findInfo(Map<String, Object> params) {
        return customerCourseService.findInfo(params);
    }

    @PostMapping("/customerCourse/doInsert")
    ServiceResult<Integer> doInsert(CustomerCourseEntity customerCourseEntity) {
        return customerCourseService.doInsert(customerCourseEntity);
    }

    @GetMapping("/customerCourse/doDeleteById")
    ServiceResult<Integer> doDeleteById(Integer customerCourseId) {
        return customerCourseService.doDeleteById(customerCourseId);
    }
}
